*******************************************	   
************* FIGURE A10 Survey analysis 
*******************************************	   

clear all
clear matrix
set more off

// Load data
use "~/Dropbox/Replication_MVC/Datasets/Survey_excombatants/survey_excombatants.dta", clear

// Prep data	
encode (Municipio), gen(origmun)
encode (Enumerator_name), gen(enumerator)
encode (ID_CODA), gen (id)

// Def crime acceptable variable
gen crime_ok=.
replace crime_ok= Social_crime22_a
replace crime_ok= Social_crime22_b if crime_ok==.

gen crime_ok2=.
replace crime_ok2= Social_crime23_a
replace crime_ok2= Social_crime23_b if crime_ok2==.
	
gen crime_acceptable=.
replace crime_acceptable= crime_ok + crime_ok2
replace crime_acceptable= crime_acceptable/2

// Regress
eststo clear
set more off

reg crime_acceptable Aftedemo_Security   i.origmun i.enumerator  if ExGrupo=="AUC", r cluster(origmun)
estimates store A5
reg crime_acceptable Aftedemo_Econsecurity   i.origmun i.enumerator  if ExGrupo=="AUC", r cluster(origmun)
estimates store B5
reg crime_acceptable Aftedemo_Image   i.origmun i.enumerator  if ExGrupo=="AUC", r cluster(origmun)
estimates store C5
reg crime_acceptable Aftedemo_friends   i.origmun i.enumerator  if ExGrupo=="AUC", r cluster(origmun)
estimates store D5
reg crime_acceptable Aftedemo_socialstatus  i.origmun i.enumerator  if ExGrupo=="AUC", r cluster(origmun)
estimates store F5	  
reg crime_acceptable Aftedemo_Adventure   i.origmun i.enumerator  if ExGrupo=="AUC", r cluster(origmun)
estimates store G5	  
reg crime_acceptable Aftedemo_Knoledge  i.origmun i.enumerator  if ExGrupo=="AUC", r cluster(origmun)
estimates store H5	  
reg crime_acceptable Aftedemo_Money   i.origmun i.enumerator  if ExGrupo=="AUC", r cluster(origmun)
estimates store I5	  
 
reg crime_acceptable Obligation_contact  i.origmun i.enumerator  if ExGrupo=="AUC", r cluster(origmun)
estimates store J5
reg crime_acceptable Obligation_excombatant  i.origmun i.enumerator  if ExGrupo=="AUC", r cluster(origmun)
estimates store K5
reg crime_acceptable Obligation_family  i.origmun i.enumerator  if ExGrupo=="AUC", r cluster(origmun)
estimates store L5

reg crime_acceptable Distance_to_commander  i.origmun i.enumerator  if ExGrupo=="AUC", r cluster(origmun)
estimates store M5
reg crime_acceptable Time_message_commander i.origmun i.enumerator  if ExGrupo=="AUC", r cluster(origmun)
estimates store N5
   
// Plot   
coefplot (A5) (B5) (C5) (D5) (F5) (G5) (H5) (I5) (J5) (K5) (L5) (M5) (N5), bylabel(AUC)   ///
      ||, keep(Aftedemo_Security Aftedemo_Econsecurity Aftedemo_Image Aftedemo_friends ///
	   Aftedemo_socialstatus Aftedemo_Adventure Aftedemo_Knoledge Aftedemo_Money ///
	  Obligation_contact Obligation_excombatant Obligation_family ///
	  Distance_to_commander Time_message_commander ) mstyle(symbol(dot)) mcolor(gray) ciopts(color(gray)) xline(0) ///
	  graphregion(fcolor(white)) ///
	  legend(off) ///
	  xlabel(,format(%13.0fc)) 	 

	  
 

	   
	   
	

	   
